<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Chapter 10 SBS signature conversion | Extract, Analyze and Visualize Mutational Signatures with Sigminer</title>
<meta name="author" content="Shixiang Wang, PhD (Sun Yat-sen University Cancer Center)">
<meta name="author" content="Xue-Song Liu, PhD (ShanghaiTech University)">
<meta name="description" content='Converts signatures between two representations relative to different sets of mutational opportunities. Currently, only SBS signature is supported. # Load SBS signature load(system.file("extdata",...'>
<meta name="generator" content="bookdown 0.28 with bs4_book()">
<meta property="og:title" content="Chapter 10 SBS signature conversion | Extract, Analyze and Visualize Mutational Signatures with Sigminer">
<meta property="og:type" content="book">
<meta property="og:description" content='Converts signatures between two representations relative to different sets of mutational opportunities. Currently, only SBS signature is supported. # Load SBS signature load(system.file("extdata",...'>
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Chapter 10 SBS signature conversion | Extract, Analyze and Visualize Mutational Signatures with Sigminer">
<meta name="twitter:description" content='Converts signatures between two representations relative to different sets of mutational opportunities. Currently, only SBS signature is supported. # Load SBS signature load(system.file("extdata",...'>
<!-- JS --><script src="https://cdnjs.cloudflare.com/ajax/libs/clipboard.js/2.0.6/clipboard.min.js" integrity="sha256-inc5kl9MA1hkeYUt+EC3BhlIgyp/2jDIyBLS6k3UxPI=" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/6.4.6/fuse.js" integrity="sha512-zv6Ywkjyktsohkbp9bb45V6tEMoWhzFzXis+LrMehmJZZSys19Yxf1dopHx7WzIKxr5tK2dVcYmaCk2uqdjF4A==" crossorigin="anonymous"></script><script src="https://kit.fontawesome.com/6ecbd6c532.js" crossorigin="anonymous"></script><script src="libs/jquery-3.6.0/jquery-3.6.0.min.js"></script><meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="libs/bootstrap-4.6.0/bootstrap.min.css" rel="stylesheet">
<script src="libs/bootstrap-4.6.0/bootstrap.bundle.min.js"></script><script src="libs/bs3compat-0.4.0/transition.js"></script><script src="libs/bs3compat-0.4.0/tabs.js"></script><script src="libs/bs3compat-0.4.0/bs3compat.js"></script><link href="libs/bs4_book-1.0.0/bs4_book.css" rel="stylesheet">
<script src="libs/bs4_book-1.0.0/bs4_book.js"></script><script src="libs/htmlwidgets-1.5.4/htmlwidgets.js"></script><link href="libs/datatables-css-0.0.0/datatables-crosstalk.css" rel="stylesheet">
<script src="libs/datatables-binding-0.24/datatables.js"></script><link href="libs/dt-core-1.11.3/css/jquery.dataTables.min.css" rel="stylesheet">
<link href="libs/dt-core-1.11.3/css/jquery.dataTables.extra.css" rel="stylesheet">
<script src="libs/dt-core-1.11.3/js/jquery.dataTables.min.js"></script><link href="libs/crosstalk-1.2.0/css/crosstalk.min.css" rel="stylesheet">
<script src="libs/crosstalk-1.2.0/js/crosstalk.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/autocomplete.js/0.38.0/autocomplete.jquery.min.js" integrity="sha512-GU9ayf+66Xx2TmpxqJpliWbT5PiGYxpaG8rfnBEk1LL8l1KGkRShhngwdXK1UgqhAzWpZHSiYPc09/NwDQIGyg==" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/mark.min.js" integrity="sha512-5CYOlHXGh6QpOFA/TeTylKLWfB3ftPsde7AnmhuitiTX4K5SqCLBeKro6sPS8ilsz1Q4NRx3v8Ko2IBiszzdww==" crossorigin="anonymous"></script><!-- CSS --><style type="text/css">
    
    div.hanging-indent{margin-left: 1.5em; text-indent: -1.5em;}
  </style>
<style type="text/css">
    /* Used with Pandoc 2.11+ new --citeproc when CSL is used */
    div.csl-bib-body { }
    div.csl-entry {
      clear: both;
        }
    .hanging div.csl-entry {
      margin-left:2em;
      text-indent:-2em;
    }
    div.csl-left-margin {
      min-width:2em;
      float:left;
    }
    div.csl-right-inline {
      margin-left:2em;
      padding-left:1em;
    }
    div.csl-indent {
      margin-left: 2em;
    }
  </style>
</head>
<body data-spy="scroll" data-target="#toc">

<div class="container-fluid">
<div class="row">
  <header class="col-sm-12 col-lg-3 sidebar sidebar-book"><a class="sr-only sr-only-focusable" href="#content">Skip to main content</a>

    <div class="d-flex align-items-start justify-content-between">
      <h1>
        <a href="index.html" title="">Extract, Analyze and Visualize Mutational Signatures with Sigminer</a>
      </h1>
      <button class="btn btn-outline-primary d-lg-none ml-2 mt-1" type="button" data-toggle="collapse" data-target="#main-nav" aria-expanded="true" aria-controls="main-nav"><i class="fas fa-bars"></i><span class="sr-only">Show table of contents</span></button>
    </div>

    <div id="main-nav" class="collapse-lg">
      <form role="search">
        <input id="search" class="form-control" type="search" placeholder="Search" aria-label="Search">
</form>

      <nav aria-label="Table of contents"><h2>Table of contents</h2>
        <ul class="book-toc list-unstyled">
<li><a class="" href="index.html">📖 Introduction</a></li>
<li class="book-part">Part I: Background and Prerequisite</li>
<li><a class="" href="mutsig-intro.html"><span class="header-section-number">1</span> Mutational signatures</a></li>
<li><a class="" href="prerequisite.html"><span class="header-section-number">2</span> Package prerequisite and installation</a></li>
<li class="book-part">Part II: Workflows</li>
<li><a class="" href="basic-workflow.html"><span class="header-section-number">3</span> Mutational signature analysis basics</a></li>
<li><a class="" href="analysis-supps.html"><span class="header-section-number">4</span> Other signature types</a></li>
<li><a class="" href="target-vis.html"><span class="header-section-number">5</span> Target visualization</a></li>
<li class="book-part">Part III: Miscellaneous topics</li>
<li><a class="" href="universal-analysis.html"><span class="header-section-number">6</span> Universal analysis</a></li>
<li><a class="" href="subtype-prediction.html"><span class="header-section-number">7</span> Subtype prediction</a></li>
<li><a class="" href="sigflow.html"><span class="header-section-number">8</span> Sigflow pipeline</a></li>
<li><a class="" href="datasets.html"><span class="header-section-number">9</span> Datasets</a></li>
<li><a class="active" href="convert.html"><span class="header-section-number">10</span> SBS signature conversion</a></li>
<li class="book-part">Appendix</li>
<li><a class="" href="references.html">References</a></li>
</ul>

        <div class="book-extra">
          
        </div>
      </nav>
</div>
  </header><main class="col-sm-12 col-md-9 col-lg-7" id="content"><div id="convert" class="section level1" number="10">
<h1>
<span class="header-section-number">10</span> SBS signature conversion<a class="anchor" aria-label="anchor" href="#convert"><i class="fas fa-link"></i></a>
</h1>
<p>Converts signatures between two representations relative to different sets of mutational opportunities. Currently, only SBS signature is supported.</p>
<div class="sourceCode" id="cb96"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="co"># Load SBS signature</span></span>
<span><span class="fu"><a href="https://rdrr.io/r/base/load.html">load</a></span><span class="op">(</span><span class="fu"><a href="https://rdrr.io/r/base/system.file.html">system.file</a></span><span class="op">(</span><span class="st">"extdata"</span>, <span class="st">"toy_mutational_signature.RData"</span>,</span>
<span>  package <span class="op">=</span> <span class="st">"sigminer"</span>, mustWork <span class="op">=</span> <span class="cn">TRUE</span></span>
<span><span class="op">)</span><span class="op">)</span></span>
<span><span class="co"># Exome-relative to Genome-relative</span></span>
<span><span class="va">sig_converted</span> <span class="op">&lt;-</span> <span class="fu"><a href="https://rdrr.io/pkg/sigminer/man/sig_convert.html">sig_convert</a></span><span class="op">(</span><span class="va">sig2</span>,</span>
<span>  from <span class="op">=</span> <span class="st">"human-exome"</span>,</span>
<span>  to <span class="op">=</span> <span class="st">"human-genome"</span></span>
<span><span class="op">)</span></span>
<span><span class="va">sig_converted</span></span>
<span><span class="co">##                  Sig1          Sig2          Sig3</span></span>
<span><span class="co">## A[C&gt;A]A  0.000000e+00  1.283652e-02 2.354578e-204</span></span>
<span><span class="co">## A[C&gt;A]C  0.000000e+00  1.866572e-02  0.000000e+00</span></span>
<span><span class="co">## A[C&gt;A]G  0.000000e+00  1.618700e-03  0.000000e+00</span></span>
<span><span class="co">## A[C&gt;A]T  0.000000e+00  7.572233e-03  0.000000e+00</span></span>
<span><span class="co">## C[C&gt;A]A  0.000000e+00  1.209076e-02  0.000000e+00</span></span>
<span><span class="co">## C[C&gt;A]C  0.000000e+00  7.032249e-03 1.170400e-133</span></span>
<span><span class="co">## C[C&gt;A]G  0.000000e+00  3.839313e-03 1.165310e-269</span></span>
<span><span class="co">## C[C&gt;A]T  0.000000e+00  1.166974e-02  0.000000e+00</span></span>
<span><span class="co">## G[C&gt;A]A  0.000000e+00  1.025669e-02  4.089543e-15</span></span>
<span><span class="co">## G[C&gt;A]C 2.975389e-296  4.002311e-03  0.000000e+00</span></span>
<span><span class="co">## G[C&gt;A]G  4.796114e-02 4.527374e-117  0.000000e+00</span></span>
<span><span class="co">## G[C&gt;A]T  0.000000e+00  5.994876e-03 1.669814e-131</span></span>
<span><span class="co">## T[C&gt;A]A  0.000000e+00  3.324941e-96  7.673114e-02</span></span>
<span><span class="co">## T[C&gt;A]C  0.000000e+00  1.467589e-02 9.720402e-229</span></span>
<span><span class="co">## T[C&gt;A]G  0.000000e+00  3.199454e-03  0.000000e+00</span></span>
<span><span class="co">## T[C&gt;A]T  0.000000e+00  2.338506e-02  0.000000e+00</span></span>
<span><span class="co">## A[C&gt;G]A  0.000000e+00  1.198076e-02 1.210238e-153</span></span>
<span><span class="co">## A[C&gt;G]C  0.000000e+00  3.999796e-03  0.000000e+00</span></span>
<span><span class="co">## A[C&gt;G]G  9.976549e-02  7.184837e-58  0.000000e+00</span></span>
<span><span class="co">## A[C&gt;G]T  0.000000e+00  7.572233e-03 9.731662e-108</span></span>
<span><span class="co">## C[C&gt;G]A  0.000000e+00  8.732217e-03  1.472610e-34</span></span>
<span><span class="co">## C[C&gt;G]C  0.000000e+00  1.875266e-03  0.000000e+00</span></span>
<span><span class="co">## C[C&gt;G]G  0.000000e+00  4.429976e-03  1.144811e-70</span></span>
<span><span class="co">## C[C&gt;G]T  1.398527e-01  1.003533e-19  0.000000e+00</span></span>
<span><span class="co">## G[C&gt;G]A 1.227107e-293  7.521572e-03 2.969058e-285</span></span>
<span><span class="co">## G[C&gt;G]C  0.000000e+00  3.001734e-03 2.665595e-168</span></span>
<span><span class="co">## G[C&gt;G]G  0.000000e+00  2.178881e-03  0.000000e+00</span></span>
<span><span class="co">## G[C&gt;G]T  0.000000e+00  3.996584e-03  0.000000e+00</span></span>
<span><span class="co">## T[C&gt;G]A  0.000000e+00  4.493267e-03 2.338585e-311</span></span>
<span><span class="co">## T[C&gt;G]C  0.000000e+00  5.336688e-03 1.100445e-248</span></span>
<span><span class="co">## T[C&gt;G]G  0.000000e+00  5.027714e-03 2.505791e-283</span></span>
<span><span class="co">## T[C&gt;G]T  0.000000e+00  8.094828e-03  4.211703e-12</span></span>
<span><span class="co">## A[C&gt;T]A  0.000000e+00  4.278842e-02 6.186711e-285</span></span>
<span><span class="co">## A[C&gt;T]C  0.000000e+00  3.266500e-02 4.009287e-180</span></span>
<span><span class="co">## A[C&gt;T]G  0.000000e+00  8.943317e-02 1.936180e-271</span></span>
<span><span class="co">## A[C&gt;T]T  0.000000e+00  2.366323e-02  0.000000e+00</span></span>
<span><span class="co">## C[C&gt;T]A  0.000000e+00  2.552494e-02  0.000000e+00</span></span>
<span><span class="co">## C[C&gt;T]C  0.000000e+00  1.406450e-02 1.334078e-226</span></span>
<span><span class="co">## C[C&gt;T]G  0.000000e+00  5.463637e-02 9.737288e-158</span></span>
<span><span class="co">## C[C&gt;T]T  0.000000e+00  3.695418e-02 4.246509e-172</span></span>
<span><span class="co">## G[C&gt;T]A  0.000000e+00 1.550033e-134  1.379990e-01</span></span>
<span><span class="co">## G[C&gt;T]C  0.000000e+00  2.401387e-02 9.655208e-197</span></span>
<span><span class="co">## G[C&gt;T]G  0.000000e+00  5.665090e-02 1.322415e-193</span></span>
<span><span class="co">## G[C&gt;T]T  0.000000e+00  3.197267e-02 1.483309e-124</span></span>
<span><span class="co">## T[C&gt;T]A  0.000000e+00  3.504749e-02 1.602583e-125</span></span>
<span><span class="co">## T[C&gt;T]C  0.000000e+00  2.868470e-02 2.192251e-133</span></span>
<span><span class="co">## T[C&gt;T]G  0.000000e+00  5.607061e-45  3.725237e-01</span></span>
<span><span class="co">## T[C&gt;T]T  0.000000e+00  2.248563e-02 5.991874e-150</span></span>
<span><span class="co">## A[T&gt;A]A  0.000000e+00 8.169022e-163 4.909543e-207</span></span>
<span><span class="co">## A[T&gt;A]C  0.000000e+00  9.451235e-03 9.169290e-161</span></span>
<span><span class="co">## A[T&gt;A]G  0.000000e+00 1.860257e-209  3.781700e-02</span></span>
<span><span class="co">## A[T&gt;A]T  0.000000e+00  3.646724e-03  0.000000e+00</span></span>
<span><span class="co">## C[T&gt;A]A  0.000000e+00  9.626354e-63 1.877035e-152</span></span>
<span><span class="co">## C[T&gt;A]C  0.000000e+00  4.098575e-03  8.954807e-03</span></span>
<span><span class="co">## C[T&gt;A]G  0.000000e+00  7.584736e-03  1.779246e-46</span></span>
<span><span class="co">## C[T&gt;A]T  0.000000e+00  4.886651e-03  0.000000e+00</span></span>
<span><span class="co">## G[T&gt;A]A  0.000000e+00 1.923466e-257  1.645056e-02</span></span>
<span><span class="co">## G[T&gt;A]C  0.000000e+00  5.990275e-03 2.816093e-138</span></span>
<span><span class="co">## G[T&gt;A]G  0.000000e+00  2.491146e-03 5.966918e-137</span></span>
<span><span class="co">## G[T&gt;A]T  1.780073e-01 1.470587e-107  0.000000e+00</span></span>
<span><span class="co">## T[T&gt;A]A  0.000000e+00  0.000000e+00  1.576605e-78</span></span>
<span><span class="co">## T[T&gt;A]C  0.000000e+00 3.652510e-193  3.025830e-02</span></span>
<span><span class="co">## T[T&gt;A]G  0.000000e+00  0.000000e+00  3.102984e-02</span></span>
<span><span class="co">## T[T&gt;A]T  0.000000e+00  5.570191e-03 2.661350e-186</span></span>
<span><span class="co">## A[T&gt;C]A  0.000000e+00  3.673499e-02 2.037390e-236</span></span>
<span><span class="co">## A[T&gt;C]C  0.000000e+00  4.875997e-80  8.069896e-02</span></span>
<span><span class="co">## A[T&gt;C]G  0.000000e+00  2.533400e-02 4.653276e-300</span></span>
<span><span class="co">## A[T&gt;C]T  0.000000e+00  3.403610e-02 1.137147e-235</span></span>
<span><span class="co">## C[T&gt;C]A  0.000000e+00  7.619558e-03  1.273356e-94</span></span>
<span><span class="co">## C[T&gt;C]C  0.000000e+00  1.116095e-02 1.501723e-122</span></span>
<span><span class="co">## C[T&gt;C]G  0.000000e+00  9.506418e-50  9.321794e-02</span></span>
<span><span class="co">## C[T&gt;C]T  0.000000e+00  1.172796e-02  1.679251e-87</span></span>
<span><span class="co">## G[T&gt;C]A  0.000000e+00  4.585040e-03  5.536247e-03</span></span>
<span><span class="co">## G[T&gt;C]C  0.000000e+00 5.073564e-255  4.133148e-02</span></span>
<span><span class="co">## G[T&gt;C]G  0.000000e+00  6.850650e-03  0.000000e+00</span></span>
<span><span class="co">## G[T&gt;C]T  3.036787e-50  1.058999e-02 7.624782e-161</span></span>
<span><span class="co">## T[T&gt;C]A  0.000000e+00 1.774320e-183  1.917769e-02</span></span>
<span><span class="co">## T[T&gt;C]C 3.471970e-224  7.796288e-03  0.000000e+00</span></span>
<span><span class="co">## T[T&gt;C]G  0.000000e+00  9.993850e-03  0.000000e+00</span></span>
<span><span class="co">## T[T&gt;C]T  0.000000e+00  2.116673e-02 4.729625e-249</span></span>
<span><span class="co">## A[T&gt;G]A  0.000000e+00  6.559820e-03  0.000000e+00</span></span>
<span><span class="co">## A[T&gt;G]C  0.000000e+00 8.576821e-159  1.467254e-02</span></span>
<span><span class="co">## A[T&gt;G]G  0.000000e+00  1.544237e-03  3.140069e-03</span></span>
<span><span class="co">## A[T&gt;G]T  0.000000e+00  3.646724e-03  0.000000e+00</span></span>
<span><span class="co">## C[T&gt;G]A  0.000000e+00  1.088508e-03  0.000000e+00</span></span>
<span><span class="co">## C[T&gt;G]C  0.000000e+00  5.252213e-03 5.352907e-111</span></span>
<span><span class="co">## C[T&gt;G]G  0.000000e+00  6.320613e-03  0.000000e+00</span></span>
<span><span class="co">## C[T&gt;G]T  1.505897e-01  2.544085e-94 2.345935e-218</span></span>
<span><span class="co">## G[T&gt;G]A  9.796461e-02  2.199487e-93 1.446688e-154</span></span>
<span><span class="co">## G[T&gt;G]C  0.000000e+00  1.996758e-03  0.000000e+00</span></span>
<span><span class="co">## G[T&gt;G]G  0.000000e+00  3.736718e-03  0.000000e+00</span></span>
<span><span class="co">## G[T&gt;G]T  0.000000e+00  3.701349e-72  1.494581e-02</span></span>
<span><span class="co">## T[T&gt;G]A  1.142049e-01 5.198170e-158  0.000000e+00</span></span>
<span><span class="co">## T[T&gt;G]C  0.000000e+00  4.872680e-03  0.000000e+00</span></span>
<span><span class="co">## T[T&gt;G]G  0.000000e+00  1.798724e-19  1.551492e-02</span></span>
<span><span class="co">## T[T&gt;G]T  1.716541e-01  1.775134e-54  0.000000e+00</span></span>
<span><span class="fu"><a href="https://rdrr.io/pkg/sigminer/man/show_sig_profile.html">show_sig_profile</a></span><span class="op">(</span><span class="va">sig2</span>, style <span class="op">=</span> <span class="st">"cosmic"</span><span class="op">)</span></span></code></pre></div>
<div class="inline-figure"><img src="sigminer_files/figure-html/unnamed-chunk-107-1.png" width="95%"></div>
<div class="sourceCode" id="cb97"><pre class="downlit sourceCode r">
<code class="sourceCode R"><span><span class="fu"><a href="https://rdrr.io/pkg/sigminer/man/show_sig_profile.html">show_sig_profile</a></span><span class="op">(</span><span class="va">sig_converted</span>, style <span class="op">=</span> <span class="st">"cosmic"</span><span class="op">)</span></span></code></pre></div>
<div class="inline-figure"><img src="sigminer_files/figure-html/unnamed-chunk-107-2.png" width="95%"></div>
</div>




<div class="chapter-nav">
<div class="prev"><a href="datasets.html"><span class="header-section-number">9</span> Datasets</a></div>
<div class="next"><a href="references.html">References</a></div>
</div></main><div class="col-md-3 col-lg-2 d-none d-md-block sidebar sidebar-chapter">
    <nav id="toc" data-toggle="toc" aria-label="On this page"><h2>On this page</h2>
      <ul class="nav navbar-nav"><li><a class="nav-link" href="#convert"><span class="header-section-number">10</span> SBS signature conversion</a></li></ul>

      <div class="book-extra">
        <ul class="list-unstyled">
          
        </ul>
</div>
    </nav>
</div>
</div>
  

  

</div>
 <!-- .container -->

<footer class="bg-primary text-light mt-5"><div class="container"><div class="row">

  <div class="col-12 col-md-6 mt-3">
    <p>"<strong>Extract, Analyze and Visualize Mutational Signatures with Sigminer</strong>" was written by Shixiang Wang, PhD (Sun Yat-sen University Cancer Center), Xue-Song Liu, PhD (ShanghaiTech University). It was last built on 2022-08-29.</p>
  </div>

  <div class="col-12 col-md-6 mt-3">
    <p>This book was built by the <a class="text-light" href="https://bookdown.org">bookdown</a> R package.</p>
  </div>

</div></div>
</footer><!-- dynamically load mathjax for compatibility with self-contained --><script>
  (function () {
    var script = document.createElement("script");
    script.type = "text/javascript";
    var src = "true";
    if (src === "" || src === "true") src = "https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.9/latest.js?config=TeX-MML-AM_CHTML";
    if (location.protocol !== "file:")
      if (/^https?:/.test(src))
        src = src.replace(/^https?:/, '');
    script.src = src;
    document.getElementsByTagName("head")[0].appendChild(script);
  })();
</script><script type="text/x-mathjax-config">const popovers = document.querySelectorAll('a.footnote-ref[data-toggle="popover"]');
for (let popover of popovers) {
  const div = document.createElement('div');
  div.setAttribute('style', 'position: absolute; top: 0, left:0; width:0, height:0, overflow: hidden; visibility: hidden;');
  div.innerHTML = popover.getAttribute('data-content');

  var has_math = div.querySelector("span.math");
  if (has_math) {
    document.body.appendChild(div);
    MathJax.Hub.Queue(["Typeset", MathJax.Hub, div]);
    MathJax.Hub.Queue(function() {
      popover.setAttribute('data-content', div.innerHTML);
      document.body.removeChild(div);
    })
  }
}
</script>
</body>
</html>
